package cn.edu.nju.software.cdiy.bean;

import java.io.Serializable;
import java.util.Date;

public class Keyboard extends Hardware implements Comparable<Keyboard>, Serializable {

	private static final long serialVersionUID = -8030990715741340021L;
	private int id;
	// 型号1
	private String model;// 键盘品牌

	// 外键品牌表1
	private BRD_KBD brand;

	// 外键接口表1
	private Interface intf;

	// 次要指标21
	private String type;
	private String connectionMode;
	private String applicableType;
	private String ergonomics;
	private String multimediaFuction;
	private String keyNum;
	private String keyTechnology;
	private String surfaceColor;
	private String handCare;
	private String waterProofFunction;
	private String backlightFunction;
	private String attachment;
	private String systemSupport;
	private String kWeight;
	private String kSize;
	private String powerSupplyMode;
	private String keyboardLineLength;
	private String CSPhone;
	private String qualityPolicy;
	private String qualityTime;
	private String qualityContent;

	// 管理类参数6
	private int iPrice;
	private int oPrice;// 出库价格
	private int performance;
	private Date inStorageTime;
	private String imgPath;
	private Value state; // 外键；{0:审核中 1:已通过}
	private double wScore;
	private double zScore;
	private int supplier;

	private int sale;
	private String rsv2;
	private String rsv3;

	public String getModel() {
		return model;
	}

	public void setModel(String model) {
		this.model = model;
	}

	public BRD_KBD getBrand() {
		return brand;
	}

	public void setBrand(BRD_KBD brand) {
		this.brand = brand;
	}

	public Interface getIntf() {
		return intf;
	}

	public void setIntf(Interface intf) {
		this.intf = intf;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getConnectionMode() {
		return connectionMode;
	}

	public void setConnectionMode(String connectionMode) {
		this.connectionMode = connectionMode;
	}

	public String getApplicableType() {
		return applicableType;
	}

	public void setApplicableType(String applicableType) {
		this.applicableType = applicableType;
	}

	public String getErgonomics() {
		return ergonomics;
	}

	public void setErgonomics(String ergonomics) {
		this.ergonomics = ergonomics;
	}

	public String getMultimediaFuction() {
		return multimediaFuction;
	}

	public void setMultimediaFuction(String multimediaFuction) {
		this.multimediaFuction = multimediaFuction;
	}

	public String getKeyNum() {
		return keyNum;
	}

	public void setKeyNum(String keyNum) {
		this.keyNum = keyNum;
	}

	public String getKeyTechnology() {
		return keyTechnology;
	}

	public void setKeyTechnology(String keyTechnology) {
		this.keyTechnology = keyTechnology;
	}

	public String getSurfaceColor() {
		return surfaceColor;
	}

	public void setSurfaceColor(String surfaceColor) {
		this.surfaceColor = surfaceColor;
	}

	public String getHandCare() {
		return handCare;
	}

	public void setHandCare(String handCare) {
		this.handCare = handCare;
	}

	public String getWaterProofFunction() {
		return waterProofFunction;
	}

	public void setWaterProofFunction(String waterProofFunction) {
		this.waterProofFunction = waterProofFunction;
	}

	public String getBacklightFunction() {
		return backlightFunction;
	}

	public void setBacklightFunction(String backlightFunction) {
		this.backlightFunction = backlightFunction;
	}

	public String getAttachment() {
		return attachment;
	}

	public void setAttachment(String attachment) {
		this.attachment = attachment;
	}

	public String getSystemSupport() {
		return systemSupport;
	}

	public void setSystemSupport(String systemSupport) {
		this.systemSupport = systemSupport;
	}

	public String getkWeight() {
		return kWeight;
	}

	public void setkWeight(String kWeight) {
		this.kWeight = kWeight;
	}

	public String getkSize() {
		return kSize;
	}

	public void setkSize(String kSize) {
		this.kSize = kSize;
	}

	public String getPowerSupplyMode() {
		return powerSupplyMode;
	}

	public void setPowerSupplyMode(String powerSupplyMode) {
		this.powerSupplyMode = powerSupplyMode;
	}

	public String getKeyboardLineLength() {
		return keyboardLineLength;
	}

	public void setKeyboardLineLength(String keyboardLineLength) {
		this.keyboardLineLength = keyboardLineLength;
	}

	public String getCSPhone() {
		return CSPhone;
	}

	public void setCSPhone(String cSPhone) {
		CSPhone = cSPhone;
	}

	public String getQualityPolicy() {
		return qualityPolicy;
	}

	public void setQualityPolicy(String qualityPolicy) {
		this.qualityPolicy = qualityPolicy;
	}

	public String getQualityTime() {
		return qualityTime;
	}

	public void setQualityTime(String qualityTime) {
		this.qualityTime = qualityTime;
	}

	public String getQualityContent() {
		return qualityContent;
	}

	public void setQualityContent(String qualityContent) {
		this.qualityContent = qualityContent;
	}

	public int getiPrice() {
		return iPrice;
	}

	public void setiPrice(int iPrice) {
		this.iPrice = iPrice;
	}

	public int getoPrice() {
		return oPrice;
	}

	public void setoPrice(int oPrice) {
		this.oPrice = oPrice;
	}

	public int getPerformance() {
		return performance;
	}

	public void setPerformance(int performance) {
		this.performance = performance;
	}

	public Date getInStorageTime() {
		return inStorageTime;
	}

	public void setInStorageTime(Date inStorageTime) {
		this.inStorageTime = inStorageTime;
	}

	public String getImgPath() {
		return imgPath;
	}

	public void setImgPath(String imgPath) {
		this.imgPath = imgPath;
	}

	public Value getState() {
		return state;
	}

	public void setState(Value state) {
		this.state = state;
	}

	public double getwScore() {
		return wScore;
	}

	public void setwScore(double wScore) {
		this.wScore = wScore;
	}

	public double getzScore() {
		return zScore;
	}

	public void setzScore(double zScore) {
		this.zScore = zScore;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public int getSupplier() {
		return supplier;
	}

	public void setSupplier(int supplier) {
		this.supplier = supplier;
	}

	public int getSale() {
		return sale;
	}

	public void setSale(int sale) {
		this.sale = sale;
	}

	public String getRsv2() {
		return rsv2;
	}

	public void setRsv2(String rsv2) {
		this.rsv2 = rsv2;
	}

	public String getRsv3() {
		return rsv3;
	}

	public void setRsv3(String rsv3) {
		this.rsv3 = rsv3;
	}

	@Override
	public int compareTo(Keyboard o) {

		Date now = new Date();

		// this的热度
		long gap = now.getTime() - inStorageTime.getTime();
		int gapDay = (int) (gap / (24 * 3600 * 1000));

		double nowHot = sale / gapDay;

		// 参数的hot
		long oGap = now.getTime() - o.getInStorageTime().getTime();
		int oGapDay = (int) (oGap / (24 * 3600 * 1000)) + 1;

		double oHot = o.getSale() / oGapDay;

		// 降序排列
		if (nowHot > oHot)
			return -1;
		else if (nowHot == oHot)
			return 0;
		else
			return 1;
	}

}
